package FileIO.Reader;

import java.io.FileReader;
import java.io.IOException;

/**
 * @Author: ylc
 * @Description:字符输入流-多字符读取
 * @Date Created in 2022-04-25 19:45
 */
public class ReaderDemo2 {
    public static void main(String[] args) throws IOException {
        FileReader fr = new FileReader("Study04\\a.txt");
        //int read(char[] cbuf)一次读取多个字符,将字符读入数组。
        char[] cs = new char[1024];
        int len2 = 0;
        while((len2 = fr.read(cs)) != -1){
            System.out.println(new String(cs, 0, len2));
        }
        fr.close();
    }
}
